package com.sky.mapper;

import com.sky.dto.BusinessDataAggrDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDate;

/**
 * @BelongsProject: sky-take-out
 * @Author: XieMingHui
 * @CreateTime: 2023-11-22  09:42
 * @Description: 数据统计dao层
 * @Version: 1.0
 */
@Mapper
public interface ShopAggrDTOMapper  {

    @Select("select count(*) newUsers from sky_take_out.user u where create_time >= #{now};")
    Integer userRegistraCount(LocalDate now);
    @Select("select count(*) validCount,sum(amount) turnover from orders where order_time >= #{now} and status =#{status};")
    BusinessDataAggrDTO BusinessData(LocalDate now,Integer status);
}
